package com.mapper.jpa;

import com.model.jpa.Player;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface PlayerRepository extends JpaRepository<Player,Long> {


    Player findByUserName(String name);

    @Query("update Player u set u.realName = ?2 where u.id = ?1")
    @Modifying
    int updateRealNameById(Long id, String realName);

}
